<template>
  <div>
    <!-- <div v-if="info.auditStatus === 'Pass' && !isHistory">
      <InfoHead
        :auditStatus="info.ruleStatus"
        :auditStatusName="info.ruleStatusName"
        :updateDateTime="info.companyRuleOffTime"
        :companyOffReason="info.companyRuleOffReason"
        :isEdit="isEdit"
        @edit="onRuleEdit"
        @revoke="onRevoke()"
      />
      <Divider />
    </div>
    <div v-if="isHistory">
      <InfoHead
        :auditStatus="info.auditStatus"
        :auditStatusName="info.auditStatusName"
        :updateDateTime="info.updateDateTime"
        :companyOffReason="info.companyOffReason"
      />
      <Divider />
    </div> -->

    <Form>
      <Row justify="space-between" align="middle">
        <h4>企业收益规则</h4>
        <!-- <BtnText v-if="isEdit" type="primary" @BtnClick="goToHistory('rule')">审核历史</BtnText> -->
      </Row>
      <Row class="com-form-item">
        <Col span="8">
          <FormItem label="规则说明:">
            <div class="view-img-box">
              <ViewImg
                v-if="info.companyRuleFiles && info.companyRuleFiles.length"
                isPreview
                isIcon
                errorMsg="证件照片"
                :fileList="info.companyRuleFiles"
              ></ViewImg>
            </div>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="收益规则:">{{ info.companyDivideIntoRuleValue }}%</FormItem>
        </Col>
      </Row>
    </Form>
  </div>
</template>

<script>
import InfoHead from './infoHead.vue'

export default {
  name: 'rulePage',
  components: { InfoHead },
  props: {
    info: {
      type: Object,
      default: () => { }
    },
    isEdit: {
      type: Boolean,
      default: false
    },
    isHistory: {
      type: Boolean,
      default: false
    },
  },
  data () {
    return {

    }
  },
  methods: {
    // 规则修改
    onRuleEdit () {
      this.$router.push({ path: '/createEditCompany', query: { type: 'rule' } })
    },
    // 去历史列表页
    goToHistory (type) {
      const companyId = this.info.companyId
      this.$router.push({ path: '/enterpriseHistory', query: { type, companyId } })
    },
     // 撤销
     onRevoke () {
      this.$emit('revoke', '2')
    },
  }
}
</script>

<style lang='less' scoped>
.mt-20 {
  margin-top: 20px;
}

.ml-20 {
  margin-left: 20px;
}
.info-title {
  margin: 10px 0;
}
.view-img-box {
  padding-top: 5px;
  margin-bottom: -5px;
}
</style>
